home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln1185.arc
/
CURVES3.LTG
< prev
next >
Wrap
Text File
|
1986-02-27
|
2KB
|
59 lines
Listing 3
subroutine matmul( m1, m2, m3 )
real m1(3,3), m2(3,3), m3(3,3), temp(3,3)
c temp = m1 * m2. áWe use a temp array so that m3 may be the same as m1.
do 30 i = 1, 3
do 20 j = 1, 3
temp(i,j) = 0
do 10 k = 1, 3
temp(i,j) = temp(i,j) + m1(i,k) * m2(k,j)ì
10 ááááááááááácontinueì
20 áááááááácontinueì
30 ááááácontinue
c m3 = temp
do 50 i = 1, 3
do 40 j = 1, 3
m3(i,j) = temp(i,j)ì
40 áááááááácontinueì
50 ááááácontinue
end
è subroutine blend( spline )
real spline(3,3), Bmat(3,3)
ááááááádata Bmat / 2, -3, 1, -4, 4, 0, 2, -1, 0 /
call matmul( spline, blend, spline )
end
subroutine eval( spline, t, point )
real spline(3,3), t, point(3), tv(3)
tv(1) = t*t
tv(2) = t
tv(3) = 1ì
c point = tv * spline
do 20 i = 1, 3
point(i) = 0
do 10 j = 1, 3
point(i) = point(i) + tv(j) * spline(j,i)ì
10 áááááááácontinueì
20 ááááácontinue
end
subroutine draw( spline )
real spline(3,3), t, point(3)
call blend( spline )
t = 0
call eval( spline, t, point )
call move( point )
do 10 i = 1, 10
t = t + .1
call eval( spline, t, point )
call draw( point )ì
10 ááááácontinue
end